package com.knowif.service;

import com.knowif.dao.OfferInterviewCommentMapper;
import com.knowif.pojo.InfoCenter;
import com.knowif.pojo.OfferInterviewComment;
import com.knowif.pojo.OfferInterviewCommentExample;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author ：Xh
 * @date ：Created in 2019/5/4 0004 21:28
 */
@Service
public class OfferInterviewComment_service {

    @Autowired
    private OfferInterviewCommentMapper offerInterviewCommentMapper;

    /**
     * 条件统计
     * @param offerInterviewCommentExample
     * @return
     */
    public int countOfferInterviewCommentByParams(OfferInterviewCommentExample offerInterviewCommentExample){
        return offerInterviewCommentMapper.countByExample(offerInterviewCommentExample);
    }

    /**
     * 根据条件删除offerInterviewComment
     * @param offerInterviewCommentExample
     * @return
     */
    public int deleteOfferInterviewCommentByParams(OfferInterviewCommentExample offerInterviewCommentExample){
        return offerInterviewCommentMapper.deleteByExample(offerInterviewCommentExample);
    }

    /**
     * 保存不为空的offerInterviewComment
     * @param offerInterviewComment
     * @return
     */
    public int saveOfferInterviewCommentNotNull(OfferInterviewComment offerInterviewComment){
        return offerInterviewCommentMapper.insertSelective(offerInterviewComment);
    }

    /**
     * 通过主键查询OfferInterviewComment
     * @param primaryKey
     * @return OfferInterviewComment
     */
    public OfferInterviewComment selectOfferInterviewCommentById(int primaryKey){
        return offerInterviewCommentMapper.selectByPrimaryKey(primaryKey);
    }

    /**
     * 通过参数更新不为空的
     * @param offerInterviewComment
     * @param offerInterviewCommentExample
     * @return
     */
    public int updateOfferInterviewCommentNotNullByParams(OfferInterviewComment offerInterviewComment, OfferInterviewCommentExample offerInterviewCommentExample){
        return offerInterviewCommentMapper.updateByExampleSelective(offerInterviewComment, offerInterviewCommentExample);
    }

    /**
     * 通过参数更新所有
     * @param offerInterviewComment
     * @param offerInterviewCommentExample
     * @return
     */
    public int updateOfferInterviewCommentByParams(OfferInterviewComment offerInterviewComment, OfferInterviewCommentExample offerInterviewCommentExample){
        return offerInterviewCommentMapper.updateByExample(offerInterviewComment, offerInterviewCommentExample);
    }

    /**
     * OfferInterviewComment条件查询
     * @param offerInterviewCommentExample
     * @return
     */
    public List<OfferInterviewComment> selectOfferInterviewComment(OfferInterviewCommentExample offerInterviewCommentExample){
        return offerInterviewCommentMapper.selectByExample(offerInterviewCommentExample);
    }

    /**
     * 插入offerInterviewComment
     * @param offerInterviewComment
     * @return
     */
    public int saveOfferInterviewComment(OfferInterviewComment offerInterviewComment){
        return offerInterviewCommentMapper.insert(offerInterviewComment);
    }

    /**
     * 更新不为空的offerInterviewComment属性
     * @param offerInterviewComment
     * @return
     */
    public int updateOfferInterviewCommentNotNull(OfferInterviewComment offerInterviewComment){
        return offerInterviewCommentMapper.updateByPrimaryKeySelective(offerInterviewComment);
    }

    /**
     * 更新所有offerInterviewComment属性
     * @param offerInterviewComment
     * @return
     */
    public int updateOfferInterviewComment(OfferInterviewComment offerInterviewComment){
        return offerInterviewCommentMapper.updateByPrimaryKey(offerInterviewComment);
    }

    /**
     * 删除offerInterviewComment
     * @param offerInterviewCommentId
     */
    public int deleteOfferInterviewComment(int offerInterviewCommentId){
        return offerInterviewCommentMapper.deleteByPrimaryKey(offerInterviewCommentId);
    }

    public List<InfoCenter> getInfoByUserId(Integer userId){
        return offerInterviewCommentMapper.getInfoByUserId(userId);
    }
}
